import React from 'react'
import { Text, View, Button, TouchableOpacity } from 'react-native'
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import HomeMain from './homeMain.jsx';
import BookDetail from './BookDetail.jsx';
import Search from './Search.jsx';
import BookReading from './bookReading';
const Stack = createNativeStackNavigator();

const Home = () => {
  return (
    <>
      <Stack.Navigator screenOptions={{ headerShown: false }} >
        <Stack.Screen name="HomeMain" component={HomeMain}
          options={{
            title: "首页",
            headerstyle: {
              //backgroundcolor:'tomato'
            },
            headerRight: () => (
              <TouchableOpacity onPress={() => alert('Hello')}>
                <Text>Hello</Text>
              </TouchableOpacity>
            )
          }}
        />
        <Stack.Screen
          name="BookContent"
          component={require('./bookContent.jsx').default}
          options={{
            headerShown: false
          }}
        />
        <Stack.Screen
          name="Search"
          component={Search}
          options={{
            headerShown: false
          }}
        />
        {/* 这里是子页面的路由 */}
        <Stack.Screen name="BookReading" component={BookReading} />
      </Stack.Navigator>
    </>
  )
}

export default Home
